package com.example.ui;

import com.example.dao.IAcountDao;
import com.example.dao.impl.AcountDaoImpl;
import com.example.service.IAcountService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:bean.xml")
public class Client {
    @Autowired
    private IAcountService ias;
    @Test
    public  void test() {
//        ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("bean.xml");
//        IAcountService ias = (IAcountService) ac.getBean("accountService");
        System.out.println(ias);
//        IAcountDao iad = ac.getBean("accountDao", IAcountDao.class);
//        IAcountDao iad2 = ac.getBean("accountDao", AcountDaoImpl.class);
//        System.out.println(iad);
//        System.out.println(iad2);
        ias.account();
//        ac.close();
    }
}
